<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="java.util.HashMap"%>
<%
	request.setCharacterEncoding("EUC-KR");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>시골가게 - 회원수정</title>
<link href="./css/css.css" rel="stylesheet" type="text/css">
</head>
<script language="javascript">
function check() {
		var f = document.custmodify; /* 문서.Form name=""; */
		var idPs = /^[0-9a-zA-Z]{4,12}$/; /* 아이디 비밀번호 체크표현식 */
		var mPs = /^[0-9]{6,12}$/;
		var eCheck = /^([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)(\.[0-9a-zA-Z_-]+){1,2}$/;

		if (f.password.value == "") {
			alert("비밀번호를 입력해주십시오");
			f.password.focus();
			return false;
		}

		if (!idPs.test(f.password.value)) {
			alert("유효한 비밀번호 형식이 아닙니다.");
			f.password.value = ""; //id값을 비워줌
			f.password.focus(); //id focus이동
			return false;
		}

		if (f.password.value != f.password2.value) {
			alert("비빌번호를 다르게 입력했습니다.");
			f.password2.select();
			return false;
		}

		if (f.email.value == "") {
			alert("이메일을 입력해주십시오");
			f.email.focus();
			return false;
		}

		if (!eCheck.test(f.email.value)) {
			alert("잘못된 이메일 형식입니다.");
			f.email.value = "";
			f.email.focus();
			return false;
		}

		if (f.phone.value == "") {
			alert("전화번호를 입력해주십시오");
			f.phone.focus();
			return false;
		}

		if (!mPs.test(f.phone.value)) {
			alert("전화번호를 올바르게 입력해 주십시오");
			f.phone.value = "";
			f.phone.focus();
			return false;
		}
	}

function openZipcode(){
	var url="zipcodeCheck1.action";
	open(url, "confirm","toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=410, height=400");
}
</script>
<body><center><br>
	<form name="custmodify" action="memberModifySuccess.action" method="post"
		onsubmit="return check()">
		<table  class="cm" width="753" class="BTABLE">
		<tr>
			<td  class="cm" height="23" colspan="5" align="center" >
		</tr>
		
			<tr>
				<td  class="cm" height="30" align="left" width="100">아이디</td>
				<td  class="cm" align="left">${resultClass.id}</td>
			</tr>
			<tr>
				<td  class="cm" height="30" align="left" width="100">비밀번호</td>
				<td  class="cm" align="left"><input type="password" name="password" size="30"	onfocus="on(this)" onblur="off(this)">
						 <font class="BFONT">영문/숫자를 이용하여 4~12자로 입력하세요</font></td>
			</tr>
			<tr>
				<td  class="cm" height="30" align="left" width="100">비밀번호 확인</td>
				<td  class="cm" align="left"><input type="password" name="password2" size="30" onfocus="on(this)" onblur="off(this)">
						<font class="BFONT">비밀번호를 재입력 해주세요</font></td>
			</tr>
			<tr>
				<td  class="cm" height="30" align="left" width="100">이 름</td>
				<td  class="cm" align="left">${resultClass.name}</td>
			</tr>
			<tr>
				<td class="cm" height="30" align="left" width="100">이메일</td>
				<td  class="cm" align="left"><input type="text" name="email" size="28" value="${resultClass.email}">
						 <font class="BFONT">이메일 형식에 맞춰 입력해 주세요</font></td>
			</tr>
			<tr>
				<td  class="cm" height="30" align="left" width="100">우편번호</td>
				<td  class="cm" align="left"><input type="text" name="zipcode"  value="${resultClass.zipcode}" size="28"/> 
						 <input type="button" value="검색" onclick="return openZipcode()" class="BBUTTON">
						<font class="BFONT">검색 버튼을 눌러 주소를 입력해 주세요</font></td>
			</tr>
			<tr>
				<td  class="cm" height="30" align="left" width="100" valign="top">주 소</td>
				<td  class="cm" align="left">
					<input type="text" name="address1" value="${resultClass.address1}" size="60"/><br> 
					<input type="text" name="address2" value="${resultClass.address2}" size="60"></td>
			</tr>
			<tr>
				<td  class="cm" height="30" align="left" width="100">전화번호</td>
				<td  class="cm" align="left"><input type="text" name="phone" size="28" value="${resultClass.phone}" onfocus="on(this)" onblur="off(this)">
						 <font class="BFONT">"-" 없이 숫자만 입력하세요</font></td>
			</tr>
			<td class="cm" align="left"><br><br><br>판매자 여부</td>
			</tr><tr><td class="cm" colspan="2">
			<input type="radio" name="power" checked="checked" id="statusAct" value="1"/>
				판매자
				<input type="radio" name="power" id="statusInac" value="2"/>
				구매자</td>
		</tr>
		<td colspan="2" class="cm">추가 입력사항 - 구매자만 입력하면 됩니다.</td>
		<tr>
			<td class="cm" height="30" align="left">은행명</td>
			<td class="cm" align="left"><input type="text" name="bank" value="${resultClass.bank}" size="20">
			</td>
		</tr>
		<tr>
			<td class="cm" height="30" align="left">계좌번호</td>
			<td class="cm" align="left"><input type="text" name="account" value="${resultClass.account}" size="40">
				<font class="BFONT">"-" 없이 숫자만 입력하세요</font>
			</td>
		</tr>
			
			<tr>
				<td class="cm"  colspan="2" align="center"><br><br>
				<input type="submit"	value="수정" class="BBUTTON">&nbsp;&nbsp;&nbsp;
				<input type="button" value="뒤로가기" onClick="javascript:history.back(-1)" class="BBUTTON">
				<br><br></td>
			</tr>
		</table><br>
	</form></center>
</body>
</html>